import requests


def parse_fanyi(self):
    url = "https://dict.youdao.com/webtranslate"
    mysticTime = self.get_ms_timestamp()  # 统一 mysticTime

    data = {
        "i": self.input,
        "from": "auto",
        "to": "en",  # 必须指定目标语言
        "useTerm": "false",
        "dictResult": "true",
        "keyid": "webfanyi",
        "sign": self.md5(
            f"client=fanyideskweb&mysticTime={mysticTime}&product=webfanyi&key={self.get_key()['data']['secretKey']}"),
        "client": "fanyideskweb",
        "product": "webfanyi",
        "appVersion": "1.0.0",
        "vendor": "web",
        "pointParam": "client,mysticTime,product",
        "mysticTime": mysticTime,  # 用同一个
        "keyfrom": "fanyi.web",
        "mid": "1",
        "screen": "1",
        "model": "1",
        "network": "wifi",
        "abtest": "0",
        "yduuid": "abcdefg"
    }

    response = requests.post(url, headers=self.headers, data=data)
    print(response.text)
